
import java.util.ArrayList;
import java.util.Collections;

public class JSMethodProxy {

	private static JSMethodProxy instance = null;

	// SETTED FROM JSImageManager
	private short[] images;

	// SETTED FROM JSMaskManager
	private short[] mask;

	// SETTED FROM JSInitialPointManager
	private short[] initialPoints;

	// SETTED FROM JSVariableManager
	double smoothCost;

	// SETTED FROM JSVariableManager
	int expandIterations;

	// SETTED FROM JSVariableManager
	int graphIterations;

	// SETTED FROM JSVariableManager
	int logFlag;

	// SETTED FROM JSImageManager
	int height;

	// SETTED FROM JSImageManager
	int width;

	// SETTED FROM JSImageManager
	int depth;

	// SETTED FROM JSImageManager
	int numberOfImages;

	// SETTED FROM INSIDE
	int numberOfRegions;

	private JSMethodProxy() {

	}

	public static JSMethodProxy getInstance() {
		if (instance == null)
			instance = new JSMethodProxy();
		return instance;
	}

	public short[] getImages() {
		return images;
	}

	public void setImages(short[] images) {
		this.images = images;
	}

	public short[] getMask() {
		return mask;
	}

	public void setMask(short[] mask) {
		this.mask = mask;
	}

	public short[] getInitialPoints() {
		return initialPoints;
	}

	public void setInitialPoints(short[] initialPoints) {
		ArrayList<Short> regions = new ArrayList<Short>();
		regions.add((short) 0);

		for (int i = 0; i < height * width * depth; i++) {
			if (!regions.contains(initialPoints[i])) {
				regions.add(initialPoints[i]);
			}
		}

		Collections.sort(regions);

		this.initialPoints = new short[height * width * depth];

		for (int i = 0; i < height * width * depth; i++) {
			this.initialPoints[i] = (short) (regions.indexOf(initialPoints[i]) - 1);
		}

		numberOfRegions = regions.size();
	}

	public double getSmoothCost() {
		return smoothCost;
	}

	public void setSmoothCost(double smoothCost) {
		this.smoothCost = smoothCost;
	}

	public int getExpandIterations() {
		return expandIterations;
	}

	public void setExpandIterations(int expandIterations) {
		this.expandIterations = expandIterations;
	}

	public int getGraphIterations() {
		return graphIterations;
	}

	public void setGraphIterations(int graphIterations) {
		this.graphIterations = graphIterations;
	}

	public int getLogFlag() {
		return logFlag;
	}

	public void setLogFlag(int logFlag) {
		this.logFlag = logFlag;
	}

	public int getHeight() {
		return height;
	}

	public void setHeight(int height) {
		this.height = height;
	}

	public int getWidth() {
		return width;
	}

	public void setWidth(int width) {
		this.width = width;
	}

	public int getDepth() {
		return depth;
	}

	public void setDepth(int depth) {
		this.depth = depth;
	}

	public int getNumberOfImages() {
		return numberOfImages;
	}

	public void setNumberOfImages(int numberOfImages) {
		this.numberOfImages = numberOfImages;
	}

	public int getNumberOfRegions() {
		return numberOfRegions;
	}

}
